using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter21
{
	/// <summary>
	/// Example01: A Tank of Helium
	/// A tank used for filling helium balloons has a volume
	/// of 0.3 m^3 and contains 2.0 mol of helium gas at 20.0 C.
	/// Assume that the helium behaves like an ideal gas.
	/// (A) What is the total translational kinetic energy of the gas
	/// molecules?
	/// K_{tot trans} = 7.3 \times 10^3 J
	/// (B) What is the average kinetic energy per molecule?
	/// \delta e = 6.07 \times 10^{-21} J 
	/// </summary>
	public class Example01
	{
		public Example01()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.IdealGas gas = new L.IdealGas();
			gas.Volume = 0.3;
			gas.Mole = 2.0;
			gas.Temperature = 20.0+273.0;
			gas.FindPressure();
			//(A)
			double total = 3.0/2.0*gas.Pressure*gas.Volume;
            result+=Convert.ToString(total);
			double average = total/gas.Mole/L.Constant.AvogadroConstant;
            result+="\r\n"+Convert.ToString(average);
		}	
	}
}
